﻿#include "stdafx.h"
#include "CLIProxy.h"

using namespace System;
namespace $RootNamespace$
{

	void Client::Main(array<System::String^> ^args)
	{
		// Create proxy and request a service 
		$ISubject$ ^subject = gcnew $Proxy$();
		subject->$Request$();
	
	}

	$ISubject$ ^$Proxy$::realSubject::get()
	{ // 'lazy initialization'
		if (_realSubject == nullptr)
			_realSubject = gcnew $RealSubject$();
		return _realSubject;
	}

	void $Proxy$::realSubject::set($ISubject$ ^value)
	{
		_realSubject = value;
	}

	void $Proxy$::$Request$()
	{
		 realSubject->$Request$();
	}

	void $RealSubject$::Test()
	{
		// Create proxy and request a service 
		$Proxy$ ^proxy = gcnew $Proxy$();
		proxy->$Request$();
	
	
	}

	void $RealSubject$::$Request$()
	{
		Console::WriteLine("Called " + this->GetType()->ToString() + "::$Request$()");
	}
}